#
# Copyright (c) 2021, gottingen group.
# All rights reserved.
# Created by liyinbin lijippy@163.com
#

package(default_visibility = ["//visibility:__pkg__"])

licenses(["notice"])

config_setting(
    name = "clang_compiler",
    flag_values = {
        "@bazel_tools//tools/cpp:compiler": "clang",
    },
    visibility = [":__subpackages__"],
)

config_setting(
    name = "osx",
    constraint_values = [
        "@bazel_tools//platforms:osx",
    ],
)

config_setting(
    name = "ios",
    constraint_values = [
        "@bazel_tools//platforms:ios",
    ],
)

config_setting(
    name = "windows",
    constraint_values = [
        "@bazel_tools//platforms:x86_64",
        "@bazel_tools//platforms:windows",
    ],
    visibility = [":__subpackages__"],
)

config_setting(
    name = "ppc",
    values = {
        "cpu": "ppc",
    },
    visibility = [":__subpackages__"],
)

config_setting(
    name = "wasm",
    values = {
        "cpu": "wasm32",
    },
    visibility = [":__subpackages__"],
)

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load(
    "//:copts/configure_copts.bzl",
    "CARBIN_DEFAULT_COPTS",
    "CARBIN_DEFAULT_LINKOPTS",
)

TESTING_HDRS = glob([
                 "*.h",
                 "*.inc",
                ])

TESTING_SRCS = glob([
                    "*.cc",
                ])
cc_library(
    name = "testing",
    srcs = TESTING_SRCS,
    hdrs = TESTING_HDRS,
    copts = CARBIN_DEFAULT_COPTS + ["-std=c++17", "-O0"],
    deps = [
        "//abel:abel",
        "@com_google_googletest//:gtest",
    ],
    visibility = ["//test:__subpackages__"],
)

